package utils;

import entity.User;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @program: FinalExam
 * @description:
 * @create: 2021-12-14 17:34
 * @Date 2021/12/14
 **/

public class InfoUtils {
    public static List<User> filterInfo(List<User> list){
        //new User(list.getId(),"******","******", list.getRealname(), list.getStatus(), list.getGmt_create(), list.getGmt_modify());
        for (User user : list) {
            user.setUsername("****");
            user.setPassword("****");
            if(user.getGmt_modify() == null){
                user.setGmt_modify("暂无记录");
            }
        }
        return list;
    }
    public static String RandomSixNumber(){
        return String.valueOf(((int)((Math.random()*9+1)*100000)));
    }
    public static String getTime(){
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        return simpleDateFormat.format(date);
    }

}
